<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>
<%@page import="com.mew.util.*" %>
<%@page import="com.humyu.school.corebase.*" %>
<% request.setCharacterEncoding("UTF-8");
	int totalcheck0=0;
        int totalcheck1=0;
        int totalcheck2=0;
        int totalcheck3=0;
        int totalcheck4=0;
        int totalcheck5=0;
        int totalcheck6=0;
        int totalcheck7=0;
        int totalcheck8=0;
	int totaluncheck0=0;
        int totaluncheck1=0;
        int totaluncheck2=0;
        int totaluncheck3=0;
        int totaluncheck4=0;
        int totaluncheck5=0;
        int totaluncheck6=0;
        int totaluncheck7=0;
        int totaluncheck8=0;
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
<SCRIPT language=javascript src="js/date.js"></SCRIPT>
<script language="javascript">
	function save(){
		document.execCommand('saveas','','report.htm');
	}
</script>
<link href="css/top_pic_n.css" rel="stylesheet" type="text/css">
</head>
<body>
  <p align="center"><strong>学生刷卡统计</strong></p>
  <table width="100%"  border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#BBD1FC">
    <tr align="center">
      <td width="10%">日期</td>
      <td width="15%">班级</td>
      <td width="8%">上午到校<br>
      (已刷/未刷)</td>
      <td width="8%">上午迟到<br>
      (已刷/未刷)</td>
      <td width="8%">上午早退<br>
      (已刷/未刷)</td>
      <td width="8%">上午离校<br>
      (已刷/未刷)</td>
      <td width="8%">下午到校<br>
      (已刷/未刷)</td>
      <td width="8%">下午迟到<br>
      (已刷/未刷)</td>
      <td width="8%">下午早退<br>
      (已刷/未刷)</td>
      <td width="8%">下午离校<br>
      (已刷/未刷)</td>
      <td width="8%">其他<br>
      (已刷/未刷)</td>
    </tr>
	<%
		List listHis = (List)request.getAttribute("listHis");//历史
                List listNow = (List)request.getAttribute("listNow");//今天
                ClassStatData csd = null;
                com.humyu.school.corebase.Class c = null;
                if(listHis!=null){
                  for(int i=0;i<listHis.size();i++){
                    csd = (ClassStatData)listHis.get(i);
					c = com.humyu.school.CoreFactory.getInstanceSchoolManager().getClass(csd.schoolid,csd.classid);
					if(c!=null){
						out.println("<tr align='center'>");
						out.println("<td>"+csd.day+"</td>");
						out.println("<td>"+c.getSchoolClassName()+"</td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=1' target='_blank'>"+(csd.keyChecked1)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=1' target='_blank'>"+csd.keyUnchecked1+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=2' target='_blank'>"+(csd.keyChecked2)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=2' target='_blank'>"+csd.keyUnchecked2+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=3' target='_blank'>"+(csd.keyChecked3)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=3' target='_blank'>"+csd.keyUnchecked3+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=4' target='_blank'>"+(csd.keyChecked4)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=4' target='_blank'>"+csd.keyUnchecked4+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=5' target='_blank'>"+(csd.keyChecked5)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=5' target='_blank'>"+csd.keyUnchecked5+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=6' target='_blank'>"+(csd.keyChecked6)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=6' target='_blank'>"+csd.keyUnchecked6+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=7' target='_blank'>"+(csd.keyChecked7)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=7' target='_blank'>"+csd.keyUnchecked7+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=8' target='_blank'>"+(csd.keyChecked8)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=8' target='_blank'>"+csd.keyUnchecked8+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=0' target='_blank'>"+(csd.keyChecked)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=0' target='_blank'>"+csd.keyUnchecked+"</a></td>");
						out.println("</tr>");
						totalcheck0 += csd.keyChecked;
						totalcheck1 += csd.keyChecked1;
						totalcheck2 += csd.keyChecked2;
						totalcheck3 += csd.keyChecked3;
						totalcheck4 += csd.keyChecked4;
						totalcheck5 += csd.keyChecked5;
						totalcheck6 += csd.keyChecked6;
						totalcheck7 += csd.keyChecked7;
						totalcheck8 += csd.keyChecked8;
						totaluncheck0 += csd.keyUnchecked;
						totaluncheck1 += csd.keyUnchecked1;
						totaluncheck2 += csd.keyUnchecked2;
						totaluncheck3 += csd.keyUnchecked3;
						totaluncheck4 += csd.keyUnchecked4;
						totaluncheck5 += csd.keyUnchecked5;
						totaluncheck6 += csd.keyUnchecked6;
						totaluncheck7 += csd.keyUnchecked7;
						totaluncheck8 += csd.keyUnchecked8;
					}
				}
              }
                //当天的
                if(listNow!=null){
                  for(int i=0;i<listNow.size();i++){
                    csd = (ClassStatData)listNow.get(i);
					c = com.humyu.school.CoreFactory.getInstanceSchoolManager().getClass(csd.schoolid,csd.classid);
					if(c!=null){
						out.println("<tr align='center'>");
						out.println("<td>"+csd.day+"</td>");
						out.println("<td>"+c.getSchoolClassName()+"</td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=1' target='_blank'>"+(csd.keyChecked1)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=1' target='_blank'>"+csd.keyUnchecked1+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=2' target='_blank'>"+(csd.keyChecked2)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=2' target='_blank'>"+csd.keyUnchecked2+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=3' target='_blank'>"+(csd.keyChecked3)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=3' target='_blank'>"+csd.keyUnchecked3+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=4' target='_blank'>"+(csd.keyChecked4)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=4' target='_blank'>"+csd.keyUnchecked4+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=5' target='_blank'>"+(csd.keyChecked5)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=5' target='_blank'>"+csd.keyUnchecked5+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=6' target='_blank'>"+(csd.keyChecked6)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=6' target='_blank'>"+csd.keyUnchecked6+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=7' target='_blank'>"+(csd.keyChecked7)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=7' target='_blank'>"+csd.keyUnchecked7+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=8' target='_blank'>"+(csd.keyChecked8)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=8' target='_blank'>"+csd.keyUnchecked8+"</a></td>");
						out.println("<td><a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"a_showcheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=0' target='_blank'>"+(csd.keyChecked)+"</a>/<a href='"+com.humyu.servlet.DispatcherServlet.PREFIX+"t_showuncheck.jsp?SchoolID="+csd.schoolid+"&ClassID="+csd.classid+"&Day="+csd.day+"&Times=0' target='_blank'>"+csd.keyUnchecked+"</a></td>");
						out.println("</tr>");
						totalcheck0 += csd.keyChecked;
						totalcheck1 += csd.keyChecked1;
						totalcheck2 += csd.keyChecked2;
						totalcheck3 += csd.keyChecked3;
						totalcheck4 += csd.keyChecked4;
						totalcheck5 += csd.keyChecked5;
						totalcheck6 += csd.keyChecked6;
						totalcheck7 += csd.keyChecked7;
						totalcheck8 += csd.keyChecked8;
						totaluncheck0 += csd.keyUnchecked;
						totaluncheck1 += csd.keyUnchecked1;
						totaluncheck2 += csd.keyUnchecked2;
						totaluncheck3 += csd.keyUnchecked3;
						totaluncheck4 += csd.keyUnchecked4;
						totaluncheck5 += csd.keyUnchecked5;
						totaluncheck6 += csd.keyUnchecked6;
						totaluncheck7 += csd.keyUnchecked7;
						totaluncheck8 += csd.keyUnchecked8;
					}
                }
              }
      out.println("<tr align='center'>");
      out.println("<td width='9%'>&nbsp;</td>");
      out.println("<td width='10%'>合计</td>");
      out.println("<td width='9%'>"+totalcheck1+"/"+totaluncheck1+"</td>");
      out.println("<td width='9%'>"+totalcheck2+"/"+totaluncheck2+"</td>");
      out.println("<td width='9%'>"+totalcheck3+"/"+totaluncheck3+"</td>");
      out.println("<td width='9%'>"+totalcheck4+"/"+totaluncheck4+"</td>");
      out.println("<td width='9%'>"+totalcheck5+"/"+totaluncheck5+"</td>");
      out.println("<td width='9%'>"+totalcheck6+"/"+totaluncheck6+"</td>");
      out.println("<td width='9%'>"+totalcheck7+"/"+totaluncheck7+"</td>");
      out.println("<td width='9%'>"+totalcheck8+"/"+totaluncheck8+"</td>");
      out.println("<td width='9%'>"+totalcheck0+"/"+totaluncheck0+"</td>");
      out.println("</tr>");
	%>
</table>
  <p align="center">
    <input type="button" name="Submit" value="返　回" onClick="history.back();">
　
<input type="button" name="Submit" value="打　印" onClick="print();">
　
<input type="button" name="Submit" value="下　载" onClick="save();">
</p>
</body>
</html>
